#!/usr/bin/env python3
"""
@Author: xueyuankui
@Date:   2022-01-22
@email: xueyuankui.good@163.com
@Function: The API used for communication with Airsim simulator
"""


class FcuInterface(object):
    """
    """

    def __init__(self):

        # Attitude
        # NED
        self.attitude_NED = (0.0, 0.0, 0.0)
        self.roll_NED = 0.0
        self.pitch_NED = 0.0
        self.yaw_NED = 0.0
        self.quaternion_NED = (1.0, 0.0, 0.0, 0.0)
        # ENU
        self.attitude_ENU = (0.0, 0.0, 0.0)
        self.roll_ENU = 0.0
        self.pitch_ENU = 0.0
        self.yaw_ENU = 0.0
        self.quaternion_ENU = (1.0, 0.0, 0.0, 0.0)

        # Position
        # global position
        self.global_position = (0.0, 0.0, 0.0)
        self.latitude = 0.0
        self.longitude = 0.0
        self.altitude = 0.0
        self.global_position_alt_rel = (0.0, 0.0, 0.0)
        self.latitude_raw = 0.0
        self.longitude_raw = 0.0
        self.altitude_raw = 0.0
        self.alt_rel = 0.0
        self.alt_amsl = 0.0
        self.alt_local = 0.0
        self.global_velocity = (0.0, 0.0, 0.0)
        self.global_vel_x = 0.0
        self.global_vel_y = 0.0
        self.global_vel_z = 0.0
        # local position
        self.local_position = (0.0, 0.0, 0.0)
        self.local_pos_x = 0.0
        self.local_pos_y = 0.0
        self.local_pos_z = 0.0
        self.local_vel_x = 0.0
        self.local_vel_y = 0.0
        self.local_vel_z = 0.0
        # home position
        self.flag_get_home = False
        self.home_global_position = (0.0, 0.0, 0.0)
        self.home_altitude = 0.0
        self.home_local_position = (0.0, 0.0, 0.0)

    def arm_disarm(self, arm):
        raise NotImplementedError

    def set_mode(self, custom_mode):
        raise NotImplementedError

    def setpoint_body_ned(self, type_mask, pvax, pvay, pvaz, yaw_value):
        raise NotImplementedError

    def setpoint_local_ned(self, type_mask, pvax, pvay, pvaz, yaw_value):
        raise NotImplementedError

    def setpoint_global_ned_alt(self, type_mask, pvax, pvay, pvaz, yaw_value):
        raise NotImplementedError

    def cmd_goto_global_position(self, lat, lon, alt, yaw, speed):
        raise NotImplementedError

    def cmd_do_orbit(self, lat, lon, alt, radius, velocity):
        raise NotImplementedError

    def exit(self):
        raise NotImplementedError
